class Jaccard:

    def __init__(self, vertex1, vertex2, vertices):
        self.vertex = (vertex1.vertex, vertex2.vertex)
        self.value = 0
        self.calc_value(vertex1, vertex2)

    def __lt__(self, other):
        return self.value < other.value

    def calc_value(self, vertex1, vertex2):
        common = 0
        for item in vertex1.sketch.sampling:
            if item in vertex2.sketch.sampling:
                common += 1
        total = len(vertex1.sketch.sampling) + len(vertex2.sketch.sampling) - common
        self.value = common / total
